@extends('layout')
@section('content')
<div class="panel panel-info">
      <div class="panel-heading">
      <h3><i class="glyphicon glyphicon-list text"></i>Ínsumos Aplicados</h3>
      </div>
    </div>

                
                <div class="panel-body">     
                <table class="table">
                    <tr>
                    <td>#</td>
                    <td>Fecha</td>
                    <td>Ganado</td>
                    <td>Sexo</td>
                    <td>Color</td>
                    <td>Insumo</td>
                    <td>Descripcion</td>
                    </tr>
                @foreach($ganadoinsumos as $ganadoinsumo)
                <tr>
                    <td>{{ $ganadoinsumo->id}}</td>
                    <td>{{ $ganadoinsumo->fecha }}</td>
                    <td>{{ Ganado::where('id',$ganadoinsumo->id_ganado)->first()->cod_ganado }}</td>

                    <td> @if( Ganado::where('id',$ganadoinsumo->id_ganado)->first()->sexo == '1')
                            Macho
                            @else
                            Hembra
                            @endif

                    </td>
                    <td>{{ Ganado::where('id',$ganadoinsumo->id_ganado)->first()->color }}</td>
                      <td>{{ Insumo::where('id',$ganadoinsumo->id_insumo)->first()->nombre }}</td>
                     <td>{{ $ganadoinsumo->descirpcion }}</td>
                </tr>
                @endforeach
                
                </table>
                </div>
                  <a href="{{route('insumos.index')}}"><button type="submit" class="btn btn-default"> Regresar</button></a>      
                </div>
                
        </div>
        {{Form:: close()}}
</html>
@stop

